//
// Created by yinlijun on 17-10-1.
//

#ifndef ROCKYSOCKET_CONNECTION_UTILS_H
#define ROCKYSOCKET_CONNECTION_UTILS_H

#include <stdlib.h>
#include <linux/socket.h>
#include <sys/socket.h>
#include <unistd.h>
#include <sys/un.h>

#ifdef __cplusplus
extern "C" {
#endif

int socket_make_sock_addr_un(const char *name, struct sockaddr_un *p_addr, socklen_t *alen);

int set_non_block(int fd);

int socket_local_server_bind(int s, const char* name);

int socket_local_server(const char* name, int type);

int socket_local_client_connect(int fd, const char* name);

int socket_local_client(const char* name, int type);

#ifdef _cplusplus
}
#endif

#endif //ROCKYSOCKET_CONNECTION_UTILS_H
